﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="DayToDayManagement_SelectDownType" Codebehind="SelectDownType.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
<style type="text/css">
body {font-size:12px;margin:0;padding:0;}
h2 {padding-left:20px;padding-top:10px;margin:0; background: url(../Include/Images/menu_title.gif) repeat-x;height:21px;font-size:14px; font-weight:600;}
.input_button {width:52px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt.gif) no-repeat;}
.menu_bg { background-color:#fef3bb; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cf994b 1px solid;}
.menu_bg1 { background-color:#f5f5f5; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cccccc 1px solid;border-top:#cccccc 1px solid;clear:left;}
</style>
    <script type="text/javascript">
        function GetStringOfSelectedDownType()
        {
            var list = document.getElementsByName('CheckDownType');
            var strTypes="";
            for(var i=0;i<list.length;i++)
            {
                if(list[i].checked)
                {
                    strTypes = strTypes + "'" + list[i].value + "',";
                }
            }
            window.returnValue=TrimEnd(strTypes);
            window.close();

        }
        function TrimEnd(str)
        {
            var length = str.length;
            if(length>0)
            {
                return str.substring(0,length-1);
            }
        }
        
        function CloseWindow()
        {
            window.returnValue="";
            window.close();
        }
        function CheckAll(chk)
        {
            var list = document.getElementsByName('CheckDownType');
            for(var i=0;i<list.length;i++)
            {
                if(chk.checked==true)
                {
                    list[i].checked=true;
                }
                else
                {
                    list[i].checked=false;
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div align="Justify">
    <h2>选择下架类型</h2>
        <div class="menu_bg1"><asp:DataList ID="dlistDownType" runat="server" RepeatColumns="3" RepeatDirection="Horizontal">
            <HeaderTemplate>
                <input id="checkAll" type="checkbox" onclick="CheckAll(this)" />全选

            </HeaderTemplate>
            <ItemTemplate>
                <input id="chkDownType" type="checkbox" name="CheckDownType" value='<%# Eval("DT_CODE")%>'><%# Eval("DT_NAME")%>
            </ItemTemplate>
        </asp:DataList></div>
        <div class="menu_bg"><input id="btnConfirm" class="input_button" type="button" value="确定" onclick="GetStringOfSelectedDownType()" />
        <input id="btnCancel" class="input_button" type="button" value="取消" onclick="CloseWindow()" /></div>
    </div>
    </form>
</body>
</html>
